const myUl = document.querySelector(".xtx_head .xtx_mainNav .father_ul")
// 鼠标点击
myUl.addEventListener("click", function (e) {
    if (e.target.tagName === 'A') {
        const myActive = document.querySelector(".xtx_head .xtx_mainNav li .active")
        if (myActive) {
            myActive.classList.remove('active')
        }
        e.target.classList.add('active')
    }
})
// 鼠标经过
myUl.addEventListener("mouseover", function (e) {
    if (e.target.tagName === 'A') {
        const myOpen = document.querySelector('.xtx_head .xtx_mainNav li .open')
        if (myOpen) {
            myOpen.classList.remove("open")
        }
        e.target.nextElementSibling.classList.add("open")
    }
})
// 鼠标移出
myUl.addEventListener("mouseleave", function (e) {
    const myOpen = document.querySelector('.xtx_head .xtx_mainNav li .open')
    if (myOpen) {
        myOpen.classList.remove("open")
    }
})